home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 037a / upconv22.zip / UPCONV.DOC < prev    next >
Text File  |  1991-09-06  |  15KB  |  290 lines

  1.  
  2.  █       █           ▄▀▀▀▀▀▀▀▄       Turbo Pascal case converter version 2.2
  3.  █       █           █                 (c) Copyright 1991 by J.W. Pluimers
  4.  █       █           █
  5.  █       █ █▀▀▀▀▀▀▀▄ █          ▄▀▀▀▀▀▀▀▄ █▀▀▀▀▀▀▀▄  █       █
  6.  █       █ █       █ █          █       █ █       █   █     █
  7.  █       █ █       █ █          █       █ █       █    █   █
  8.  █       █ █       █ █       ▄  █       █ █       █     █ █
  9.   ▀▀▀▀▀▀▀  █▀▀▀▀▀▀▀   ▀▀▀▀▀▀▀    ▀▀▀▀▀▀▀  ▀       ▀      ▀
  10.            █
  11.            █      For information on other products :     P.S.O.
  12.            █                                              P.O. Box 266
  13.            █                                              2170 AG Sassenheim
  14.                                                           The Netherlands
  15.  
  16.  
  17.     Introduction
  18.     ------------
  19.  
  20.         UpConv is a case conversion program designed for Turbo Pascal
  21.     versions 3.0 to 6.0 and TPW 1.0, which can easilly be adapted to
  22.     newer versions of Turbo Pascal.
  23.  
  24.         Case conversion is the process of reformatting identifiers in
  25.     pascal source code to some predefined way. Borland international is
  26.     very consistent in their manuals, all the identifiers are lower case,
  27.     all other identifiers have some predefined case convention (mostly
  28.     lower case with the first letters of words to upper case).
  29.  
  30.         Because is is very likely that you have your own style of case
  31.     convention (for example, use all upper case) and you want to have other
  32.     source code in that format as well, UpConv has been developed. It reads
  33.     pascal files (not only Turbo Pascal) and writes new reformatted files
  34.     with all identifiers according to the case convention you desire.
  35.  
  36.  
  37.     Options
  38.     -------
  39.  
  40.         The usage of UpConv has been kept very simple, and a summary is
  41.     shown when you type UpConv without any parameters or with the -? or
  42.     -h switch.
  43.  
  44.         UpConv can read any text file (you can even specify wildcards to
  45.     specify many files at once), but output files have the extension .FMT.
  46.     Just like the Turbo Pascal compiler only outputs .EXE files.
  47.  
  48.         You can choose whether or not the output files will be overwritten
  49.     when they exist already, the default is to skip those files.
  50.  
  51.         Reformatting actions on input files consists of two main areas;
  52.     case conversion and comment parsing.
  53.  
  54.         Case conversion can be done on four catagories of words :
  55.  
  56.             - reserved words
  57.             - compiler directives
  58.             - Borland identifiers
  59.             - user identifiers
  60.  
  61.         For each you can select what to :
  62.  
  63.             - convert to upper case
  64.             - convert to lower case
  65.             - convert the first character to uppercase
  66.             - do not convert
  67.             - convert according to identifier table
  68.  
  69.         Combinations of the above are allowed, and are summarized in a
  70.     table below for reference.
  71.  
  72.         A very nice feature of UpConv is the possiblity not to ignore
  73.     comment tokens (these { } and (* *) tokens are ways to add comments
  74.     or disable source text). It is possible to temporarily comment out
  75.     source text, which will still be reformatted. The default setting is
  76.     to parse source text between (* and *) tokens, but the exact way can
  77.     be selected from the command line. Comments between braces { and }
  78.     can be processed too, but this option is left off by default. Be
  79.     warned if you reformat a file that contains real comments between (*
  80.     and *), some text may look pretty weird afterward!
  81.  
  82.  
  83.  
  84.     Usage
  85.     -----
  86.  
  87.         The command line usage is kept very simple, and the default
  88.     settings are convenient for most people. Above all, you can
  89.     reconfigure the identifier table and command line options with
  90.     UpConfig (see below).
  91.  
  92.         The command line can consists of file names and switches,
  93.     the switches come before file names on which they act. File names
  94.     can consist of wildcards (both * and ? are allowed) which means that
  95.     a whole bunch of files can be processed at once. Each file name is
  96.     being converted into the same file with the extension .FMT (ForMaT).
  97.     The syntax then is as follows :
  98.  
  99.     ┌────────────────────────────────────────────────────────────────────┐
  100.     │                                                                    │
  101.     │   UpConv [switch...] sourcefile [[switch...] [sourcefile]...]      │
  102.     │                                                                    │
  103.     └────────────────────────────────────────────────────────────────────┘
  104.  
  105.         Each switch can consist of actions (optionally followed with the
  106.     object on which they apply) and options. Both are case insensitive
  107.     and can start either with - or /.
  108.  
  109.     ┌─────────────────────────────────────────────────────────────────────┐
  110.     │                                                                     │
  111.     │   switch = [action[apply...]] [option...]                           │
  112.     │                                                                     │
  113.     └─────────────────────────────────────────────────────────────────────┘
  114.  
  115.         There are two kinds of actions. The first kind determines what
  116.     to do with identifiers, the second kind tells the program if and how
  117.     comments are parsed.
  118.  
  119.     ┌────────────────────────────────────────────────────────────────────┐
  120.     │   Identifier actions/applies :                                     │
  121.     │                                                                    │
  122.     │            action                            apply                 │
  123.     │                                                                    │
  124.     │   -u  Convert to upperCase.           r  Reserved words.           │
  125.     │   -l  Convert to lowerCase.           b  Borland identifiers.      │
  126.     │   -f  UpperCase first character.      u  User identifiers.         │
  127.     │   -n  Do not convert.                 d  Compiler directives.      │
  128.     │   -x  Default settings.            none  Apply to all above.       │
  129.     └────────────────────────────────────────────────────────────────────┘
  130.  
  131.     ┌────────────────────────────────────────────────────────────────────┐
  132.     │   Comment actions/applies :                                        │
  133.     │                                                                    │
  134.     │            action                            apply                 │
  135.     │                                                                    │
  136.     │   -e  Enable comment parsing.         p  Parenthese comments.      │
  137.     │   -d  Disable comment parsing.        b  Brace comments.           │
  138.     │                                    none  Both comments.            │
  139.     └────────────────────────────────────────────────────────────────────┘
  140.  
  141.         Last, but not least, there are two options that determine the
  142.     behavior of UpConv if a destination file exists.
  143.  
  144.     ┌────────────────────────────────────────────────────────────────────┐
  145.     │   Options :                                                        │
  146.     │                                                                    │
  147.     │   -o  Overwrite destination files.                                 │
  148.     │   -s  Skip existing destination files.                             │
  149.     └────────────────────────────────────────────────────────────────────┘
  150.  
  151.         For actions and applies it is possible to combine one or more
  152.     applies of an action, just type in the action letter followed with
  153.     the applie letters. For example :
  154.  
  155.     ┌────────────────────────────────────────────────────────────────────┐
  156.     │   UpConv -urb IOLIB.PAS                                            │
  157.     │                                                                    │
  158.     │   - converts IOLIB.PAs into IOLIB.FMT                              │
  159.     │   - changes reserved words and Borland identifiers to uppercase    │
  160.     │   - changes the compiler directives to the form in the table       │
  161.     │   - changes user identifiers to the first identifier found         │
  162.     └────────────────────────────────────────────────────────────────────┘
  163.  
  164.         It is also possible to specifie more actions on the same
  165.     identifier, just type two action switches with the same applies :
  166.  
  167.     ┌────────────────────────────────────────────────────────────────────┐
  168.     │   UpConv -ld -fd GRDEMO.PAS                                        │
  169.     │                                                                    │
  170.     │   - converts GRDEMO.PAS into GRDEMO.FMT                            │
  171.     │   - changes compiler directives to lowercase with the first letter │
  172.     │     uppercased                                                     │
  173.     │   - changes reserved words and Borland identifiers to the format   │
  174.     │     of the conversion table                                        │
  175.     │   - changes user identifiers to the first identifier found         │
  176.     └────────────────────────────────────────────────────────────────────┘
  177.  
  178.         As a reference the next table comes in handy, it describes what
  179.      combination of actions gives what results on the source code.
  180.      Note that the actions are not reset to default values when a new
  181.      group of files is being converted!
  182.  
  183.      ┌───────────────────────────────────────────────────────────────────┐
  184.      │  Combined action result table :                                   │
  185.      │                                                                   │
  186.      │  State now │ New action                                           │
  187.      │  ──────────┼────────────────────────────────────────────────────  │
  188.      │            │ Table   UpCase   LoCase    First     Nothing         │
  189.      │  ──────────┼────────────────────────────────────────────────────  │
  190.      │    Table   │ Table   UpCase   LoCase    FTable    Nothing         │
  191.      │    LoCase  │ Table   UpCase   LoCase    FLoCase   Nothing         │
  192.      │    UpCase  │ Table   UpCase   LoCase    UpCase    Nothing         │
  193.      │    First   │ Table   UpCase   FLoCase   First     Nothing         │
  194.      │    FLoCase │ Table   UpCase   FLoCase   FLoCase   Nothing         │
  195.      │    FTable  │ Table   UpCase   FLoCase   FTable    Nothing         │
  196.      │    Nothing │ Table   UpCase   LoCase    First     Nothing         │
  197.      │                                                                   │
  198.      │  Legenda:                                                         │
  199.      │                                                                   │
  200.      │    State   │ Conversion                                           │
  201.      │  ──────────┼────────────────────────────────────────────────────  │
  202.      │    Table   │ according to table                                   │
  203.      │    LoCase  │ to lowercase                                         │
  204.      │    UpCase  │ to uppercase                                         │
  205.      │    First   │ first letter to uppercase                            │
  206.      │    FLoCase │ to lowercase, then uppercase first character         │
  207.      │    FTable  │ according to table, then uppercase first character   │
  208.      │    Nothing │ do not convert                                       │
  209.      └───────────────────────────────────────────────────────────────────┘
  210.  
  211.         Inspection of the above table reveals that some options can't be
  212.     set at once by command line switches. FLoCase and FTable need two
  213.     switches to bee set.
  214.  
  215.  
  216.     UpConfig
  217.     --------
  218.  
  219.         Real programms mean nothing without configuration
  220.     possibillities, so even UpConv has it's own configuration program :
  221.     UpConfig.
  222.  
  223.         UpConfig can configure the UpConv utilitie at two sides; it can
  224.     modifie the built-in identifier table and it can change the default
  225.     command-line switches. Both processes are done at the same time, so
  226.     you can't change one without the other.
  227.  
  228.         The syntax of UpConfig is essentially the same, except that no
  229.     file names can be issued, it always reads the identifier table from
  230.     UPCONV.TXT and configures UPCONV.EXE. Perhaps this changes in a
  231.     future release, but configuration won't be issued very much, so this
  232.     is all it can at this moment.
  233.  
  234.         Because you must have access to the default identifier table in
  235.     order to extent it, the original file - the file with which UpConv
  236.     has been compiled - is in the file UPCONV.TXT. Many efforts have
  237.     been made to keep this table up to date, and it contains all
  238.     identifiers found in the MS-DOS versions of Turbo Pascal 3.0 to
  239.     Turbo Pascal 5.5. All compiler files and Turbo Pascal units have
  240.     been checked to make this table as complete as possible, but there
  241.     is still a chance that a few are missing. When you find such an
  242.     identifier, please contact the address above so a new update can be
  243.     made.
  244.  
  245.         Note that no CP/M identifiers (like BDOS) are contained as this
  246.     version of UpConv only works on MS-DOS machines.
  247.  
  248.  
  249.     Disclaimer & License
  250.     --------------------
  251.  
  252.         This software and documentation is supplied to you "AS IS"
  253.     without any representation or warranty of any kind, either expressed
  254.     or implied, including, but not limited to, the implied warranties of
  255.     quality, performance, merchantabilty and fitness for a particular
  256.     purpose.
  257.  
  258.         In no event will Jeroen W. Pluimers be liable for any damages,
  259.     either direct, indirect, special, incidental or consequential,
  260.     caused by the use, or inability to use, these programms, even if
  261.     Jeroen W. Pluimers has been advised of the possibility of such
  262.     damages. In particular, Jeroen W. Pluimers shall have no liablility
  263.     for any files manipulated with this software, including costs for
  264.     receovering damage possibly caused by it.
  265.  
  266.         You, the licensee agree with the statements in the disclaimer
  267.     and license section of this document by reading any part of it or
  268.     using the product and you are assuming the entire risk as to quality
  269.     and performance of software or documentation.
  270.  
  271.         With this software and documentation, you may :
  272.  
  273.         - use the program on only one machine at any one time
  274.         - make copies of the software and dosumentation only for backup
  275.           or modifiaction purposes ONLY in support of your authorized use
  276.         - modify and/or merge the software and or documentation only in
  277.           suppoert of you authorized use.
  278.  
  279.         but you may not :
  280.  
  281.         - use, copy, modify, merge or transfer copies of the software
  282.           or documentation except as noted in this section
  283.         - reverse assemble, reverse engineer, or reverse compile the
  284.           software without prior permission of Jeroen W. Pluimers
  285.         - sublicense, rent, lease or assign the software or
  286.           documentation or any copy of it.
  287.  
  288.     For any questions, site-licenses, custom-versions, please contact
  289.     the address at the top of this document.
  290.